<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>管理博客</title>
    <th:block th:include="hander/navigation :: common(~{::links})"></th:block>
    <!--  js引入  -->
    <th:block th:include="/hander/navigation :: commonjs"></th:block>

</head>
<body class="after-body">
<!--  顶部导航栏  -->
<th:block th:replace="/hander/navigation :: navheader" ></th:block>
<div class="row body2 leftuserinfo">
<div class="col-md-12" style="margin: 25px 0 0 0;" >
<form id="blogForm">
<!--  右边区域  -->
    <div class="blog-title" id="adminblogright" style="float: right;">
<!--     文章管理区域   -->
        <div id="topz">
            <ul class="nav nav-tabs">
               <li class="active">
                   <a onclick="window.location.reload();">全部(<span th:text="${pageEssay.getTotal()}"></span>)</a>
               </li>
               <li class="">
                   <a onclick="openEssay(1,5,0)">公开</a>
               </li>
               <li class="">
                   <a href="#" onclick="openEssay(1,5,1)">私有</a>
               </li>
               <li class="">
                   <a onclick="recycleEssay(1,5)">回收站</a>
               </li>
            </ul>
        </div>
<!--  主要文章内容   -->
        <div id="recycleEssay"  th:if="${pageEssay.getTotal() != 0 }">
            <span style="margin-top: 15px;">
                <div style="margin-top: 30px;border: 1px dashed #7f8087;width: available;"></div>
<!-- 异步更新数据 -->
                <span id="wenzhang">
                <th:block th:each="essay,essayStat:${pageEssay.getObjects()}">
                    <h4 style="margin-top: 19px;font-weight: 600;">
                       <a  th:href="@{/essay/select-blogdetails(eid=${essay.eid})}" style="color: #0d1021" th:text="${essay.etitle}"></a>
                    </h4>
                    <span >
                        <span th:text="${essay.estate} == 0 ? '原创':'转载' "></span>
                        &emsp;
                        <span th:text="${#dates.format(essay.gmtModified,'yyyy-MM-dd HH:mm:ss')}" >2020-02-24 15:12:00</span>&emsp;&emsp;
                        <img src="/images/index/fw.png" class="img-circle" width="20px" height="20px" alt="访问量" title="访问量">
                            <span th:text="${essay.eReadStatis}">32</span>
                            &emsp;
                        <img src="/images/index/comment.png" class="img-circle" width="20px" height="20px"  alt="评论量" title="评论量">
                            <span th:text="${essay.eComment}">32</span>
                            &emsp;
                        <img src="/images/index/dz0.png" class="img-circle" style="margin-top: -5px;" width="20px" height="20px"  alt="点赞量" title="点赞量">
                            <span th:text="${essay.ePraiseStati}">32</span>
                            &emsp;
                        <img src="/images/index/shoucang.png" class="img-circle" width="20px" height="20px"  alt="收藏量" title="收藏量">
                            <span th:text="${essay.eCollect}">32</span>
                        <div style="float: right">
                            <div class="btn-group-sm">
                                 <button type="button" class="btn btn-link" style="text-decoration: none;outline: none;">
                                     <a th:href="@{/essay/select-blogdetails(eid=${essay.eid})}">查看</a>
                                 </button>
                                    &boxv;
                                 <button type="button" class="btn btn-link" style="text-decoration: none;outline: none;">
                                     <ul class="nav nav-tabs">
                                         <li class="dropdown">
                                             <a class="dropdown-toggle btn btn-link"
                                                style="text-decoration: none;border: 0px;outline: none;background: white;"
                                                data-toggle="dropdown" href="#"
                                                th:text="${essay.estatus } == 0 ? '公开':'私有' ">
                                                 <span class="caret"></span>
                                             </a>
                                             <ul class="dropdown-menu">
                                                  <li>
                                                      <a  th:onclick="|updateOpenOrPrivate(${essay.eid},${essay.estatus == 0 ? 1:0 },-1)|" th:text="${essay.estatus } == 0 ? '私有':'公开' ">私有</a>
                                                  </li>
                                             </ul>
                                         </li>
                                     </ul>
                                 </button>
                                    &boxv;
                                <button type="button" class="btn btn-link" style="text-decoration: none;outline: none;">置顶</button>
                                    &boxv;
                                <button type="button" class="btn btn-link" style="text-decoration: none;outline: none;" th:onclick="|delEssay(${essay.eid},1,-1)|">删除</button>
                            </div>
                        </div>
                    </span>
                    <div style="margin-top: 30px;border: 1px dashed #7f8087;width: available;"></div>
                </th:block>
                </span>
            </span>
            <!--            分页          -->
            <div class="plq" id="fenye" style="text-align: center;">
                <ul class="pagination">
                    <li ><a th:href="@{/essay/admin-essay(page=${pageEssay.getCurrent()} - 1 <= 0 ? 1: ${pageEssay.getCurrent()},size=${pageEssay.getSize()})}" >&laquo;</a></li>
                    <th:block th:each="i:${#numbers.sequence(1,pageEssay.getPages())}">
                        <li class="" >
                            <a th:href="@{/essay/admin-essay(page=${i},size=${pageEssay.getSize()})}" th:text="${i}" >1</a>
                        </li>
                    </th:block>
                    <li ><a th:href="@{/essay/admin-essay(page=${pageEssay.getCurrent()} + 1,size=${pageEssay.getSize()})}" >&raquo;</a></li>
                </ul>
            </div>
        </div>
        <div id="recycleEssay" th:if="${pageEssay.getTotal() == 0 }">
            <div style="margin-top: 15px;">
                <div style="margin-top: 30px;border: 1px dashed #7f8087;width: available;"></div>
                <span id="wenzhang">
                    <div style="text-align: center;margin-top: 25px;">暂无文章</div>
                    <div style="margin-top: 30px;border: 1px dashed #7f8087;width: available;"></div>
                </span>
                <!--            分页          -->
                <div class="plq" id="fenye" style="text-align: center;"></div>
            </div>
        </div>

    </div>
<!--  左侧个人类别区域  -->
    <div style="float: left;margin-bottom: 20px;" >
        <th:block th:replace="/hander/navigation :: adminBlog-left"></th:block>
    </div>
</form>
</div>
</div>
<!-- 模态框（Modal） -->
<div class="modal fade " id="createSpecial" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">
                    &times;
                </button>
                <h4 class="modal-title" style="font-weight: 600" id="myModalLabel">
                    个人分类
                </h4>
            </div>
            <div class="modal-body">
                <form class="form-horizontal row" role="form" id="specialForm">
                    <div class="form-group">
                        <label class="col-sm-2 control-label" for="sname">分类名称：</label>
                        <div class="col-sm-10">
                            <input type="text" class="form-control" name="sname" id="sname" placeholder="请输入分类名称" />
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label" for="sdescribe">描述：</label>
                        <div class="col-sm-10">
                            <textarea name="sdescribe" id="sdescribe" maxlength="255" class="form-control" placeholder="请描述一下该分类"></textarea>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label" for="surl">描述：</label>
                        <div class="col-sm-10">
                            <input type="file"  name="surl" id="surl" />
                        </div>
                    </div>
                </form>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal">关闭
                </button>
                <button type="button" class="btn btn-primary" data-dismiss="modal" onclick="createSpecial()" >
                    提交
                </button>
            </div>
        </div><!-- /.modal-content -->
    </div><!-- /.modal -->
</div>
<style>
    .blog-title{
        width: 800px;
        height: auto;
    }
    .top-left{
        margin-top: 30px;
    }
</style>
</body>

</html>
